/*
 * @Author: DUST
 * @Date: 2023-05-17 13:52:26
 * @LastEditors: DUST
 * @LastEditTime: 2023-06-27 10:03:47
 * @FilePath: \vite-project\src\views\browse\noteList\index.ts
 * @Description: 
 * undefined
 */
import { notePage } from "@/api/forceEnd";
import ForceEndPage from "@/class/forceEndPage";
import router from "@/router";
import { RouteLocation } from "vue-router";

export interface pageItem {
  index: number;
  id: number;
  title: string;
  author: string;
  description: string;
  tagList: Array<{ id: number; name: string }>;
}
class Notes extends ForceEndPage<pageItem> {
  constructor(currentRoute: RouteLocation) {
    super({ AJAXFunc: notePage, routeMatched: currentRoute.matched  });
  }

  /**
   * @description: 查看详情
   * @param {pageItem} item: 查看的选项
   */
  public goToDetails = (item: pageItem) => {
    router.push({ path: `/learning/noteDetails/${item.id}` })
  };
}

export default Notes;
